<template>
	<div class="son">
		<h1>我是Son组件</h1>
		<button @click="sendToy">点我把玩具给父亲玩</button>
	</div>
</template>

<script>
	export default {
		name:'Son',
		data() {
			return {
				toy:'四驱车'
			}
		},
		methods: {
			sendToy(){
				this.$emit('get-toy',this.toy)
			}
		},
	}
</script>

<style>
	.son{
		background-color: skyblue;
		padding: 20px;
	}
</style>